import com.example.demo.chap2.MainConfig2;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
//@Autowired标注在setter方法上，通过setter方法注入
public class test1 {
    /**
     * 使用setter注入简单值
     */
    @Test
    void testSetter01() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext-chapter02.xml");
        Customer customer03 = applicationContext.getBean("customer03", Customer.class);
        customer03.display();
        Customer customer04 = applicationContext.getBean("customer04", Customer.class);
        customer04.display();
    }
}
